//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    titles: [
      {
        id: 0,
        title: "推荐"
      },
      {
        id: 1,
        title: "热点"
      },
      {
        id: 2,
        title: "成都"
      },
      {
        id: 3,
        title: "娱乐"
      },
      {
        id: 0,
        title: "推荐"
      },
      {
        id: 1,
        title: "热点"
      },
      {
        id: 2,
        title: "成都"
      },
      {
        id: 3,
        title: "娱乐"
      }
    ],
    news: []
  },
  onLoad: function () {
    wx.request({
      url: 'https://api.apiopen.top/getWangYiNews',
      data: {
        page: "1",
        count: "10"
      },
      success: ({data}) => {
        this.setData({ news: data.result });
      }
    })
  },
  showDetial: function (e) {
    wx.navigateTo({
      url: '../webdetail/webdetail?url=' + encodeURIComponent(e.target.dataset.url),
      success:()=>{
        
      },
    })
  }
})
